package com.mzx.pojo;

import com.mzx.Demo.ProxyInvocationHandler;

public class Client {
    public static void main(String[] args) {
        //真实角色：房东租房子,
        Host host=new Host();
        //代理角色：现在没有
        ProxyInvocationHandler pih = new ProxyInvocationHandler();
        pih.setRent(host);
        //动态生成代理类
        Rent proxy = (Rent) pih.getProxy();//这里的proxy是动态生成的

        proxy.rent();


    }
}
